$(function (){
    //加载默认隐藏展示页
    $(".show").hide()
    //单击后获取输入内容
    $(".btn").bind("click",function (){
        var word1 = $(".word1").val();
        var word2 = $(".word2").val();
        console.log(word1)
        console.log(word2)
        $.ajax({
            type: "post",
            url: "/nlp?action=wordSiment",
            data: {
                word1: word1,
                word2: word2
            },
            dataType: "json",
            success: function (data){
                console.log(data)
                console.log(data.score)
                $("#sim").html(data.score)
                console.log("成功")
            },
            error : function (err){
                console.log("失败")
            }
        })
        //单击后展示隐藏页面
        $(".show").show()
    })

})



